#include"SeqList.h"
void print(struct SeqList s)
{
	for (int i = 0; i < s._size; i++)
	{
		printf("%d  ", s._pArr[i]);
	}
	printf("\n");
	printf("size:%d\n", s._size);
	printf("capacity:%d\n", s._capacity);
}
void test01()
{
	struct SeqList s;
	SeqListInit(&s);
	SeqListPushBack(&s, 1);
	SeqListPushBack(&s, 2);
	SeqListPushBack(&s, 3);
	/*SeqListPushBack(&s, 5);
	SeqListPushBack(&s, 5);*/
	/*SeqListPushBack(&s, 15);
	SeqListPushBack(&s, 25);
	SeqListPushBack(&s, 35);
	SeqListPushFront(&s, 100);
	SeqListPushFront(&s, 200);
	SeqListPushFront(&s, 300);*/
	/*SeqListPopBack(&s);
	SeqListPopBack(&s);
	SeqListPopBack(&s);
	SeqListPopBack(&s);*/
	SeqListPopFront(&s);
	SeqListPopFront(&s);
	SeqListPopFront(&s);
	SeqListPopFront(&s);
	//SeqListInsert(&s, 8, 99);
	//SeqListErase(&s, 30);
	print(s);
}


void test02(int a)
{
	assert(a==1);
	printf("hello world\n");
}


void test03()
{
	struct SeqList s;
	SeqListInit(&s);
	SeqListPushBack(&s, 1);
	SeqListPushBack(&s, 2);
	SeqListPushBack(&s, 3);
	SeqListPushBack(&s, 4);
	SeqListPushBack(&s, 5);
	print(s);
	printf("-----------\n");
	/*SeqListPushFront(&s, 11);
	SeqListPushFront(&s, 21);
	SeqListPushFront(&s, 341);
	SeqListPushFront(&s, 9991);
	print(s);*/
	/*SeqListPopFront(&s);
	SeqListPopFront(&s);

	SeqListPopFront(&s);
	SeqListPopFront(&s);
	SeqListPopFront(&s);
	SeqListPopFront(&s);*/

	SeqListPopBack(&s);
	SeqListPopBack(&s);
	SeqListPopBack(&s);
	SeqListPopBack(&s);
	SeqListPopBack(&s);
	SeqListPopBack(&s);
	print(s);
}




void test04()
{
	struct SeqList s;
	SeqListInit(&s);
	SeqListInsert(&s,1, 1);
	SeqListInsert(&s, 1, 2);
	SeqListInsert(&s, 1, 3);
	SeqListInsert(&s, 1, 4);
	SeqListInsert(&s, 1, 5);
	SeqListErase(&s, 1);
	SeqListErase(&s, 1);
	SeqListErase(&s, 1);
	SeqListErase(&s, 1);
	SeqListErase(&s, 1);
	SeqListErase(&s, 1);

	print(s);
}

void test05()
{
	struct SeqList s;
	SeqListInit(&s);
	////SeqListPopFront(&s);
	//SeqListPopBack(&s);
	SeqListPushFront(&s, 1);
	SeqListPushFront(&s, 2);
	SeqListPushFront(&s, 3);
	SeqListPushFront(&s, 4);
	SeqListPushBack(&s, 11);
	SeqListPushBack(&s, 102);
	SeqListPushBack(&s, 38);
	SeqListPushBack(&s, 381);
	SeqListPushBack(&s, 237);
	print(s);
}

void test06()
{
	struct SeqList s;
	SeqListInit(&s);
	SeqListInsert(&s, 1, 1);
	SeqListInsert(&s, 1, 2);
	SeqListInsert(&s, 1, 3);
	SeqListInsert(&s, 1, 4);
	int pos = SeqListFind(&s, 1);
	print(s);
	printf("pos = %d\n", pos);
	SeqListDestroy(&s);
	print(s);
}
void main()
{
	//test01();
	//test02(11);
	//test03();
	//test04();
	//test05();
	test06();
	return 0;
}